package cn.tedu.spring.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserSerice {
    @Value("注册")
    private String sname;
    /*
      Autowired:注入对象类型的数据，根据类型进行注入
      1.添加到属性上;
      2.添加到set方法上;
      3.添加到构造方法上；
     */
    @Autowired
    private UserDao userDao;

    @Override
    public String toString() {
        return "UserSerice{" +
                "sname='" + sname + '\'' +
                ", userDao=" + userDao +
                '}';
    }
}
